<template>
  <el-dialog :title="i18n['log.sys.dialog.title']"
             :close-on-click-modal="false"
             :visible.sync="visible">
    <el-form :model="dataForm"
             :rules="dataRule"
             ref="dataForm"
             @keyup.enter.native="dataFormSubmit()"
             label-width="80px">
      <el-form-item :label="i18n['log.sys.field.method.title']"
                    prop="method">
        <el-input v-model="dataForm.method"
                  type="textarea"
                  :rows="4"
                  :placeholder="i18n['log.sys.field.method.title']"></el-input>
      </el-form-item>
      <el-form-item :label="i18n['log.sys.field.params.title']"
                    prop="params">
        <el-input v-model="dataForm.params"
                  type="textarea"
                  :rows="10"
                  :placeholder="i18n['log.sys.field.params.title']"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer"
          class="dialog-footer">
      <el-button @click="visible = false">{{i18n['gobal.button.close']}}</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  inject: ['i18n'],
  data () {
    return {
      visible: false,
      dataForm: {
        logId: 0,
        method: '',
        params: ''
      },
    }
  },
  methods: {
    init (row) {
      this.dataForm.logId = row.logId
      this.dataForm.method = row.method
      this.dataForm.params = row.params
      this.visible = true
    },
  }
}
</script>

